/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * Main.java
 *
 * Created on Apr 23, 2011, 2:23:10 AM
 */
package c0907m.group2.aitsm.gui;

import c0907m.group2.aitsm.core.db.UserDb;
import c0907m.group2.aitsm.core.entity.UserInfo;
import c0907m.group2.aitsm.gui.component.StatusBar;
import c0907m.group2.aitsm.gui.handler.*;
import c0907m.group2.aitsm.util.Helper;
import c0907m.group2.aitsm.util.Settings;

import javax.swing.*;
import java.awt.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.File;
import java.io.IOException;
import java.sql.SQLException;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 * @author Group 2
 *         Application's main interface
 */
public class Main extends JFrame {
    public final Logger logger = Logger.getLogger(Main.class.getName());
    public static JDialog popUpConfig;
    private UserInfo loginUser;
    private Login loginPane;

    /**
     * Creates new form Main
     */
    public Main() {
        initComponents();
        doStyle();
        Helper.initSystem();
        doConfig();
    }

    /**
     * Form styling
     */
    private void doStyle() {
        //setMinimumSize();
        setTitle("AITSM");
        setMaximumSize(new Dimension(1024, 768));
        setMaximizedBounds(new Rectangle(1024, 768));
        setExtendedState(JFrame.MAXIMIZED_BOTH);

        //Change Java logo to user-created logo
        try {
            setIconImage(Toolkit.getDefaultToolkit()
                    .getImage(new File(Settings.IMAGES_DIR + "/app_logo.png")
                            .getCanonicalPath()));
        } catch (IOException ex) {
            logger.log(Level.SEVERE, "Failed to load application logo.");
        }
        pack();
        setVisible(true);
    }

    /**
     * Load a panel into main pane
     *
     * @param c panel to load
     */
    private void loadComponentsToMainPane(JPanel c) {
        pnMain.removeAll();
        pnMain.setLayout(new BorderLayout());
        JScrollPane sp = new JScrollPane(c);
        pnMain.add(sp, BorderLayout.CENTER);
        //pnMain.add(c, BorderLayout.CENTER);
        pnMain.revalidate();
    }

    /**
     * Pop up Config dialog
     */
    public void doConfig() {
        popUpConfig = new JDialog(this, "Configuration");
        Config configPane = new Config();
        configPane.addServerConnectedListener(new ServerConnectedListener() {

            public void serverConnected(ServerConnectedEvent evt) {
                doLogin();
            }
        });

        //attach status bar
        configPane.setStatusBar(statusBar);
        statusBar.setMessage(Config.DEFAULT_STATUS, StatusBar.MESSAGE_TYPE);
        //Center popup
        //Rectangle r = this.getBounds();
        //int x = r.x + (r.width -  popUpConfig.getSize().width)/2;
        //int y = r.y + (r.height - popUpConfig.getSize().height)/2;
        //popUpConfig.setLocation(x, y);
        popUpConfig.setLocationRelativeTo(jToolBar2);
        //popUpConfig.setLocationByPlatform(true);
        popUpConfig.setModal(true);
        popUpConfig.setContentPane(configPane);
        popUpConfig.getRootPane().setDefaultButton(configPane.getDefaultButton());
        popUpConfig.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
        popUpConfig.addWindowListener(new WindowAdapter() {
            @Override
            public void windowClosing(WindowEvent e) {
                int confirm = JOptionPane.showConfirmDialog(
                        popUpConfig,
                        "Close this dialog will exit application, are you sure?",
                        "Warning",
                        JOptionPane.OK_CANCEL_OPTION
                );

                if (confirm == JOptionPane.YES_OPTION) {
                    System.exit(0);
                }
            }
        });
        popUpConfig.pack();
        popUpConfig.setVisible(true);
    }

    /**
     * Pop up Login dialog
     */
    public void doLogin() {
        final JDialog dlgLogin = new JDialog();
        loginPane = new Login();
        loginPane.addLoggedInListener(new LoggedInListener() {
            public void loggedIn(LoggedInEvent evt) {
                dlgLogin.dispose();
                loginUser = loginPane.getLoginUser();
                //String today = Helper.fromDate(Calendar.getInstance().getTime(),"MMM dd yyyy");
                String helloMessage = new StringBuilder()
                        .append("Hello, ")
                        .append(loginUser.getName()).append(".")
                                //.append("\n\n").append(today)
                        .toString();
                statusBar.setMessage(helloMessage, StatusBar.MESSAGE_TYPE);

                setAdminFunctionsEnabled(loginUser.isAdmin());
            }
        });

        dlgLogin.setContentPane(loginPane);
        dlgLogin.getRootPane().setDefaultButton(loginPane.getDefaultButton());
        dlgLogin.setPreferredSize(new Dimension(522, 222));
        dlgLogin.setLocationRelativeTo(jToolBar2);
        dlgLogin.setResizable(false);
        dlgLogin.setModal(true);

        dlgLogin.addWindowListener(new WindowAdapter() {
            @Override
            public void windowClosing(WindowEvent e) {
                int confirm = JOptionPane.showConfirmDialog(
                        dlgLogin,
                        "Close this dialog will exit application, are you sure?",
                        "Warning",
                        JOptionPane.OK_CANCEL_OPTION
                );

                if (confirm == JOptionPane.YES_OPTION) {
                    System.exit(0);
                }
            }
        });
        dlgLogin.pack();
        dlgLogin.setVisible(true);

    }

    /**
     * Disconnect current logged in user from system
     */
    public void doLogout() {
        loginUser = null;
        pnMain.removeAll();
        pnMain.repaint();
        doLogin();
    }

    /**
     * Set administrator functions enable or disable
     * depends on which role is granted for this user
     *
     * @param enable true for enable
     */
    private void setAdminFunctionsEnabled(boolean enable) {
        //set enable for all menu items
        mitCourses.setEnabled(enable);
        mitCourseSubject.setEnabled(enable);
        mitCourseYears.setEnabled(enable);
        mitFine.setEnabled(enable);
        mitSemesters.setEnabled(enable);
        mitSubjects.setEnabled(enable);
        mitUsers.setEnabled(enable);
        mitUserSubject.setEnabled(enable);
        mitClasses.setEnabled(enable);

        //set enable for all toolbar button
        btnCourses.setEnabled(enable);
        btnCourseSubject.setEnabled(enable);
        btnCourseYears.setEnabled(enable);
        btnFine.setEnabled(enable);
        btnSemester.setEnabled(enable);
        btnSubjects.setEnabled(enable);
        btnUsers.setEnabled(enable);
        btnUserSubject.setEnabled(enable);
        btnClasses.setEnabled(enable);
    }

    /**
     * This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        dlgChangePw = new javax.swing.JDialog();
        pnChangePw = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jpfOldPw = new javax.swing.JPasswordField();
        jpfNewPw = new javax.swing.JPasswordField();
        jpfConfirmPw = new javax.swing.JPasswordField();
        btnSave = new javax.swing.JButton();
        btnCancel = new javax.swing.JButton();
        dlgUserInfo = new javax.swing.JDialog();
        pnUserInfo = new javax.swing.JPanel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        lblName = new javax.swing.JLabel();
        lblEmail = new javax.swing.JLabel();
        lblMobile = new javax.swing.JLabel();
        lblRole = new javax.swing.JLabel();
        jSeparator5 = new javax.swing.JSeparator();
        jToolBar1 = new javax.swing.JToolBar();
        btnProfile = new javax.swing.JButton();
        btnLogOut = new javax.swing.JButton();
        jToolBar2 = new javax.swing.JToolBar();
        btnUsers = new javax.swing.JButton();
        btnStudents = new javax.swing.JButton();
        btnSubjects = new javax.swing.JButton();
        btnCourses = new javax.swing.JButton();
        btnSchedules = new javax.swing.JButton();
        btnClasses = new javax.swing.JButton();
        btnCourseYears = new javax.swing.JButton();
        btnSemester = new javax.swing.JButton();
        btnAttendance = new javax.swing.JButton();
        btnCourseSubject = new javax.swing.JButton();
        btnUserSubject = new javax.swing.JButton();
        btnFine = new javax.swing.JButton();
        jToolBar3 = new javax.swing.JToolBar();
        btnCalculator = new javax.swing.JButton();
        jSeparator2 = new javax.swing.JSeparator();
        jcpMain = new javax.swing.JScrollPane();
        pnMain = new javax.swing.JPanel();
        statusBar = new StatusBar();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu5 = new javax.swing.JMenu();
        mitConfig = new javax.swing.JMenuItem();
        jSeparator1 = new javax.swing.JPopupMenu.Separator();
        mitExit = new javax.swing.JMenuItem();
        jMenu1 = new javax.swing.JMenu();
        mitProfile = new javax.swing.JMenuItem();
        mitLogOut = new javax.swing.JMenuItem();
        jMenu2 = new javax.swing.JMenu();
        jMenu6 = new javax.swing.JMenu();
        mitUsers = new javax.swing.JMenuItem();
        mitUserSubject = new javax.swing.JMenuItem();
        mitStudents = new javax.swing.JMenuItem();
        mitSubjects = new javax.swing.JMenuItem();
        jMenu7 = new javax.swing.JMenu();
        mitCourses = new javax.swing.JMenuItem();
        mitCourseSubject = new javax.swing.JMenuItem();
        mitSchedules = new javax.swing.JMenuItem();
        mitClasses = new javax.swing.JMenuItem();
        mitCourseYears = new javax.swing.JMenuItem();
        mitSemesters = new javax.swing.JMenuItem();
        jSeparator4 = new javax.swing.JPopupMenu.Separator();
        mitAttendance = new javax.swing.JMenuItem();
        mitFine = new javax.swing.JMenuItem();
        jMenu3 = new javax.swing.JMenu();
        mitCalculator = new javax.swing.JMenuItem();
        jMenu4 = new javax.swing.JMenu();
        mitHelp = new javax.swing.JMenuItem();
        jSeparator3 = new javax.swing.JPopupMenu.Separator();
        mitAbout = new javax.swing.JMenuItem();

        dlgChangePw.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        dlgChangePw.setModalExclusionType(null);
        dlgChangePw.setModalityType(null);

        pnChangePw.setBackground(new java.awt.Color(255, 255, 255));

        jLabel1.setText("Old password:");

        jLabel2.setText("New password:");

        jLabel3.setText("Confirm password:");

        btnSave.setIcon(new ImageIcon(Settings.IMAGES_DIR + "/save_btn.png"));
        btnSave.setText("Save");
        btnSave.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSaveActionPerformed(evt);
            }
        });

        btnCancel.setIcon(new ImageIcon(Settings.IMAGES_DIR + "/delete_btn.png"));
        btnCancel.setText("Cancel");
        btnCancel.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCancelActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout pnChangePwLayout = new javax.swing.GroupLayout(pnChangePw);
        pnChangePw.setLayout(pnChangePwLayout);
        pnChangePwLayout.setHorizontalGroup(
                pnChangePwLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(pnChangePwLayout.createSequentialGroup()
                                .addContainerGap()
                                .addGroup(pnChangePwLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                        .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addComponent(jLabel3, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addComponent(jLabel2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addGroup(pnChangePwLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                        .addGroup(pnChangePwLayout.createSequentialGroup()
                                                .addComponent(btnSave, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addComponent(btnCancel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                        .addComponent(jpfConfirmPw)
                                        .addComponent(jpfNewPw)
                                        .addComponent(jpfOldPw, javax.swing.GroupLayout.DEFAULT_SIZE, 163, Short.MAX_VALUE))
                                .addContainerGap(80, Short.MAX_VALUE))
        );
        pnChangePwLayout.setVerticalGroup(
                pnChangePwLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(pnChangePwLayout.createSequentialGroup()
                                .addGap(29, 29, 29)
                                .addGroup(pnChangePwLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(jLabel1)
                                        .addComponent(jpfOldPw, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(18, 18, 18)
                                .addGroup(pnChangePwLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(jLabel2)
                                        .addComponent(jpfNewPw, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(18, 18, 18)
                                .addGroup(pnChangePwLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(jLabel3)
                                        .addComponent(jpfConfirmPw, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(26, 26, 26)
                                .addGroup(pnChangePwLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(btnSave)
                                        .addComponent(btnCancel))
                                .addContainerGap(41, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout dlgChangePwLayout = new javax.swing.GroupLayout(dlgChangePw.getContentPane());
        dlgChangePw.getContentPane().setLayout(dlgChangePwLayout);
        dlgChangePwLayout.setHorizontalGroup(
                dlgChangePwLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(pnChangePw, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        );
        dlgChangePwLayout.setVerticalGroup(
                dlgChangePwLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(pnChangePw, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        );

        dlgUserInfo.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

        pnUserInfo.setBackground(new java.awt.Color(255, 255, 255));

        jLabel4.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel4.setForeground(new java.awt.Color(0, 0, 255));
        jLabel4.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel4.setText("USER PROFILE");

        jLabel5.setText("Name:");

        jLabel6.setText("Email:");

        jLabel7.setText("Mobile:");

        jLabel8.setText("Role:");

        jLabel9.setFont(new java.awt.Font("Tahoma", 2, 11));
        jLabel9.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel9.setText("Please contact Administrator to change your profile information.");

        lblName.setText("jLabel10");

        lblEmail.setText("jLabel11");

        lblMobile.setText("jLabel12");

        lblRole.setText("jLabel13");

        javax.swing.GroupLayout pnUserInfoLayout = new javax.swing.GroupLayout(pnUserInfo);
        pnUserInfo.setLayout(pnUserInfoLayout);
        pnUserInfoLayout.setHorizontalGroup(
                pnUserInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE)
                        .addComponent(jLabel9, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE)
                        .addGroup(pnUserInfoLayout.createSequentialGroup()
                                .addContainerGap()
                                .addComponent(jSeparator5, javax.swing.GroupLayout.DEFAULT_SIZE, 380, Short.MAX_VALUE)
                                .addContainerGap())
                        .addGroup(pnUserInfoLayout.createSequentialGroup()
                                .addContainerGap()
                                .addGroup(pnUserInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                        .addComponent(jLabel5, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addComponent(jLabel6, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addComponent(jLabel8, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addComponent(jLabel7, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addGroup(pnUserInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(lblName)
                                        .addComponent(lblEmail)
                                        .addComponent(lblMobile)
                                        .addComponent(lblRole))
                                .addContainerGap(296, Short.MAX_VALUE))
        );
        pnUserInfoLayout.setVerticalGroup(
                pnUserInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(pnUserInfoLayout.createSequentialGroup()
                                .addContainerGap()
                                .addComponent(jLabel4)
                                .addGap(29, 29, 29)
                                .addGroup(pnUserInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(jLabel5)
                                        .addComponent(lblName))
                                .addGap(18, 18, 18)
                                .addGroup(pnUserInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(jLabel6)
                                        .addComponent(lblEmail))
                                .addGap(18, 18, 18)
                                .addGroup(pnUserInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(jLabel7)
                                        .addComponent(lblMobile))
                                .addGap(18, 18, 18)
                                .addGroup(pnUserInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(jLabel8)
                                        .addComponent(lblRole))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 39, Short.MAX_VALUE)
                                .addComponent(jSeparator5, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabel9, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addContainerGap())
        );

        javax.swing.GroupLayout dlgUserInfoLayout = new javax.swing.GroupLayout(dlgUserInfo.getContentPane());
        dlgUserInfo.getContentPane().setLayout(dlgUserInfoLayout);
        dlgUserInfoLayout.setHorizontalGroup(
                dlgUserInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(pnUserInfo, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        dlgUserInfoLayout.setVerticalGroup(
                dlgUserInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(pnUserInfo, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosing(java.awt.event.WindowEvent evt) {
                formWindowClosing(evt);
            }
        });

        jToolBar1.setFloatable(false);
        jToolBar1.setRollover(true);

        btnProfile.setIcon(new ImageIcon(Settings.IMAGES_DIR + "/profile-32.png"));
        btnProfile.setToolTipText("Account profile");
        btnProfile.setFocusable(false);
        btnProfile.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnProfile.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnProfile.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnProfileActionPerformed(evt);
            }
        });
        jToolBar1.add(btnProfile);

        btnLogOut.setIcon(new ImageIcon(Settings.IMAGES_DIR + "/logout-32.png"));
        btnLogOut.setToolTipText("Log out");
        btnLogOut.setFocusable(false);
        btnLogOut.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnLogOut.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnLogOut.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnLogOutActionPerformed(evt);
            }
        });
        jToolBar1.add(btnLogOut);

        jToolBar2.setFloatable(false);
        jToolBar2.setRollover(true);

        btnUsers.setIcon(new ImageIcon(Settings.IMAGES_DIR + "/users-32.png"));
        btnUsers.setToolTipText("Edit users");
        btnUsers.setFocusable(false);
        btnUsers.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnUsers.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnUsers.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnUsersActionPerformed(evt);
            }
        });
        jToolBar2.add(btnUsers);

        btnStudents.setIcon(new ImageIcon(Settings.IMAGES_DIR + "/student-32.png"));
        btnStudents.setToolTipText("Edit students");
        btnStudents.setFocusable(false);
        btnStudents.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnStudents.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnStudents.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnStudentsActionPerformed(evt);
            }
        });
        jToolBar2.add(btnStudents);

        btnSubjects.setIcon(new ImageIcon(Settings.IMAGES_DIR + "/subject-32.png"));
        btnSubjects.setToolTipText("Edit subjects");
        btnSubjects.setFocusable(false);
        btnSubjects.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnSubjects.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnSubjects.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSubjectsActionPerformed(evt);
            }
        });
        jToolBar2.add(btnSubjects);

        btnCourses.setIcon(new ImageIcon(Settings.IMAGES_DIR + "/course-32.png"));
        btnCourses.setToolTipText("Edit courses");
        btnCourses.setFocusable(false);
        btnCourses.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnCourses.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnCourses.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCoursesActionPerformed(evt);
            }
        });
        jToolBar2.add(btnCourses);

        btnSchedules.setIcon(new ImageIcon(Settings.IMAGES_DIR + "/schedule-32.png"));
        btnSchedules.setToolTipText("Edit schedules");
        btnSchedules.setFocusable(false);
        btnSchedules.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnSchedules.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnSchedules.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSchedulesActionPerformed(evt);
            }
        });
        jToolBar2.add(btnSchedules);

        btnClasses.setIcon(new ImageIcon(Settings.IMAGES_DIR + "/class-32.png"));
        btnClasses.setToolTipText("Edit classes");
        btnClasses.setFocusable(false);
        btnClasses.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnClasses.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnClasses.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnClassesActionPerformed(evt);
            }
        });
        jToolBar2.add(btnClasses);

        btnCourseYears.setIcon(new ImageIcon(Settings.IMAGES_DIR + "/course_year-32.png"));
        btnCourseYears.setToolTipText("Edit course years");
        btnCourseYears.setFocusable(false);
        btnCourseYears.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnCourseYears.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnCourseYears.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCourseYearsActionPerformed(evt);
            }
        });
        jToolBar2.add(btnCourseYears);

        btnSemester.setIcon(new ImageIcon(Settings.IMAGES_DIR + "/semester-32.png"));
        btnSemester.setToolTipText("Edit semesters");
        btnSemester.setFocusable(false);
        btnSemester.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnSemester.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnSemester.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSemesterActionPerformed(evt);
            }
        });
        jToolBar2.add(btnSemester);

        btnAttendance.setIcon(new ImageIcon(Settings.IMAGES_DIR + "/attendance-32.png"));
        btnAttendance.setToolTipText("Check attendance");
        btnAttendance.setFocusable(false);
        btnAttendance.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnAttendance.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnAttendance.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnAttendanceActionPerformed(evt);
            }
        });
        jToolBar2.add(btnAttendance);

        btnCourseSubject.setIcon(new ImageIcon(Settings.IMAGES_DIR + "/course_subject-32.png"));
        btnCourseSubject.setToolTipText("Edit which subject belongs to which course");
        btnCourseSubject.setFocusable(false);
        btnCourseSubject.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnCourseSubject.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnCourseSubject.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCourseSubjectActionPerformed(evt);
            }
        });
        jToolBar2.add(btnCourseSubject);

        btnUserSubject.setIcon(new ImageIcon(Settings.IMAGES_DIR + "/user_subject-32.png"));
        btnUserSubject.setToolTipText("Edit which subject is taught by which user");
        btnUserSubject.setFocusable(false);
        btnUserSubject.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnUserSubject.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnUserSubject.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnUserSubjectActionPerformed(evt);
            }
        });
        jToolBar2.add(btnUserSubject);

        btnFine.setIcon(new ImageIcon(Settings.IMAGES_DIR + "/fine-32.png"));
        btnFine.setToolTipText("Check fine");
        btnFine.setFocusable(false);
        btnFine.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnFine.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnFine.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnFineActionPerformed(evt);
            }
        });
        jToolBar2.add(btnFine);

        jToolBar3.setFloatable(false);
        jToolBar3.setRollover(true);

        btnCalculator.setIcon(new ImageIcon(Settings.IMAGES_DIR + "/calculator-32.png"));
        btnCalculator.setToolTipText("Calculator");
        btnCalculator.setFocusable(false);
        btnCalculator.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnCalculator.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnCalculator.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCalculatorActionPerformed(evt);
            }
        });
        jToolBar3.add(btnCalculator);

        pnMain.setAutoscrolls(true);

        javax.swing.GroupLayout pnMainLayout = new javax.swing.GroupLayout(pnMain);
        pnMain.setLayout(pnMainLayout);
        pnMainLayout.setHorizontalGroup(
                pnMainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGap(0, 949, Short.MAX_VALUE)
        );
        pnMainLayout.setVerticalGroup(
                pnMainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGap(0, 886, Short.MAX_VALUE)
        );

        jcpMain.setViewportView(pnMain);

        statusBar.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);

        jMenu5.setText("System");

        mitConfig.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_C, java.awt.event.InputEvent.ALT_MASK | java.awt.event.InputEvent.CTRL_MASK));
        mitConfig.setText("Reconnect to server");
        mitConfig.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mitConfigActionPerformed(evt);
            }
        });
        jMenu5.add(mitConfig);
        jMenu5.add(jSeparator1);

        mitExit.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F4, java.awt.event.InputEvent.ALT_MASK));
        mitExit.setText("Exit");
        mitExit.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mitExitActionPerformed(evt);
            }
        });
        jMenu5.add(mitExit);

        jMenuBar1.add(jMenu5);

        jMenu1.setText("Account");

        mitProfile.setText("Profile");
        mitProfile.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mitProfileActionPerformed(evt);
            }
        });
        jMenu1.add(mitProfile);

        mitLogOut.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_D, java.awt.event.InputEvent.CTRL_MASK));
        mitLogOut.setText("Log out");
        mitLogOut.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mitLogOutActionPerformed(evt);
            }
        });
        jMenu1.add(mitLogOut);

        jMenuBar1.add(jMenu1);

        jMenu2.setText("Manage");

        jMenu6.setText("Users");

        mitUsers.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_1, java.awt.event.InputEvent.CTRL_MASK));
        mitUsers.setText("Edit users");
        mitUsers.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mitUsersActionPerformed(evt);
            }
        });
        jMenu6.add(mitUsers);

        mitUserSubject.setText("Manage user-subject relationship");
        mitUserSubject.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mitUserSubjectActionPerformed(evt);
            }
        });
        jMenu6.add(mitUserSubject);

        jMenu2.add(jMenu6);

        mitStudents.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_2, java.awt.event.InputEvent.CTRL_MASK));
        mitStudents.setText("Students");
        mitStudents.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mitStudentsActionPerformed(evt);
            }
        });
        jMenu2.add(mitStudents);

        mitSubjects.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_3, java.awt.event.InputEvent.CTRL_MASK));
        mitSubjects.setText("Subjects");
        mitSubjects.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mitSubjectsActionPerformed(evt);
            }
        });
        jMenu2.add(mitSubjects);

        jMenu7.setText("Courses");

        mitCourses.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_4, java.awt.event.InputEvent.CTRL_MASK));
        mitCourses.setText("Edit courses");
        mitCourses.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mitCoursesActionPerformed(evt);
            }
        });
        jMenu7.add(mitCourses);

        mitCourseSubject.setText("Manage course-subject relationship");
        mitCourseSubject.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mitCourseSubjectActionPerformed(evt);
            }
        });
        jMenu7.add(mitCourseSubject);

        jMenu2.add(jMenu7);

        mitSchedules.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_5, java.awt.event.InputEvent.CTRL_MASK));
        mitSchedules.setText("Schedules");
        mitSchedules.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mitSchedulesActionPerformed(evt);
            }
        });
        jMenu2.add(mitSchedules);

        mitClasses.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_6, java.awt.event.InputEvent.CTRL_MASK));
        mitClasses.setText("Classes");
        mitClasses.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mitClassesActionPerformed(evt);
            }
        });
        jMenu2.add(mitClasses);

        mitCourseYears.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_7, java.awt.event.InputEvent.CTRL_MASK));
        mitCourseYears.setText("Course Years");
        mitCourseYears.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mitCourseYearsActionPerformed(evt);
            }
        });
        jMenu2.add(mitCourseYears);

        mitSemesters.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_8, java.awt.event.InputEvent.CTRL_MASK));
        mitSemesters.setText("Semesters");
        mitSemesters.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mitSemestersActionPerformed(evt);
            }
        });
        jMenu2.add(mitSemesters);
        jMenu2.add(jSeparator4);

        mitAttendance.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_9, java.awt.event.InputEvent.CTRL_MASK));
        mitAttendance.setText("Check attendance");
        mitAttendance.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mitAttendanceActionPerformed(evt);
            }
        });
        jMenu2.add(mitAttendance);

        mitFine.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_0, java.awt.event.InputEvent.CTRL_MASK));
        mitFine.setText("Check fine");
        mitFine.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mitFineActionPerformed(evt);
            }
        });
        jMenu2.add(mitFine);

        jMenuBar1.add(jMenu2);

        jMenu3.setText("Tools");

        mitCalculator.setText("Calculator");
        mitCalculator.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mitCalculatorActionPerformed(evt);
            }
        });
        jMenu3.add(mitCalculator);

        jMenuBar1.add(jMenu3);

        //Modified code
        mnTheme = new JMenu();
        mnTheme.setText("Theme");

        mitSAutumnLaf = new JMenuItem();
        mitSAutumnLaf.setText("Autumn");
        mitSAutumnLaf.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                Helper.setLookAndFeel(Settings.SUBSTANCE_AUTUMN_LNF);
                updateUI();
            }
        });
        
        mitSCremeLaf = new JMenuItem();
        mitSCremeLaf.setText("Creme");
        mitSCremeLaf.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                Helper.setLookAndFeel(Settings.SUBSTANCE_CREME_LNF);
                updateUI();
            }
        });
        
        mitSBlackBusinessLaf = new JMenuItem();
        mitSBlackBusinessLaf.setText("Black steel business");
        mitSBlackBusinessLaf.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                Helper.setLookAndFeel(Settings.SUBSTANCE_BLACK_BUSSINESS_LNF);
                updateUI();
            }
        });

        JMenuItem mitDefaultLaf = new JMenuItem();
        mitDefaultLaf.setText("Reset to default");
        mitDefaultLaf.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                Helper.setLookAndFeel(Settings.SUBSTANCE_BLACK_BUSSINESS_LNF);
                updateUI();
            }
        });

        mnTheme.add(mitSAutumnLaf);
        mnTheme.add(mitSCremeLaf);
        mnTheme.add(mitSBlackBusinessLaf);
        mnTheme.add(new JSeparator());
        mnTheme.add(mitDefaultLaf);
        jMenuBar1.add(mnTheme);

        jMenu4.setText("Help");

        mitHelp.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F1, 0));
        mitHelp.setText("Help Content");
        mitHelp.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mitHelpActionPerformed(evt);
            }
        });
        jMenu4.add(mitHelp);
        jMenu4.add(jSeparator3);

        mitAbout.setText("About");
        mitAbout.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mitAboutActionPerformed(evt);
            }
        });
        jMenu4.add(mitAbout);

        jMenuBar1.add(jMenu4);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(layout.createSequentialGroup()
                                .addContainerGap()
                                .addComponent(statusBar, javax.swing.GroupLayout.DEFAULT_SIZE, 968, Short.MAX_VALUE))
                        .addGroup(layout.createSequentialGroup()
                                .addComponent(jToolBar1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jToolBar2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jToolBar3, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addContainerGap())
                        .addGroup(layout.createSequentialGroup()
                                .addComponent(jSeparator2, javax.swing.GroupLayout.DEFAULT_SIZE, 968, Short.MAX_VALUE)
                                .addContainerGap())
                        .addGroup(layout.createSequentialGroup()
                                .addContainerGap()
                                .addComponent(jcpMain, javax.swing.GroupLayout.DEFAULT_SIZE, 968, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                        .addComponent(jToolBar3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addComponent(jToolBar1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addComponent(jToolBar2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jcpMain, javax.swing.GroupLayout.DEFAULT_SIZE, 479, Short.MAX_VALUE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(statusBar, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        jToolBar1.addSeparator(new Dimension(1, 50));
        jToolBar2.addSeparator(new Dimension(1, 50));

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void updateUI() {
        SwingUtilities.updateComponentTreeUI(this);
    }

    private void mitConfigActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mitConfigActionPerformed
        doConfig();
    }//GEN-LAST:event_mitConfigActionPerformed

    private void mitExitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mitExitActionPerformed
        try {
            Config.connection.close();
            //System.out.println("Exiting..");
        } catch (SQLException e1) {
            logger.log(Level.WARNING, "Unable to close connection.");
        } finally {
            System.exit(0);
        }
    }//GEN-LAST:event_mitExitActionPerformed

    private void mitProfileActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mitProfileActionPerformed
        if (pnMain.getComponentCount() != 0 && pnMain.getComponent(0) instanceof UserProfile) {
            return;
        }
        UserProfile userPane = new UserProfile();
        loadComponentsToMainPane(userPane);
        userPane.setStatusBar(statusBar);
		userPane.setLoginUser(loginUser);
        statusBar.setMessage(UserProfile.DEFAULT_STATUS, StatusBar.MESSAGE_TYPE);
    }//GEN-LAST:event_mitProfileActionPerformed

    private void mitLogOutActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mitLogOutActionPerformed
        int option = JOptionPane.showConfirmDialog(
                null,
                "Are you sure want to log out?",
                "Confirm message",
                JOptionPane.YES_NO_OPTION);
        if (option == JOptionPane.YES_OPTION) {
            doLogout();
        }
    }//GEN-LAST:event_mitLogOutActionPerformed

    private void mitUsersActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mitUsersActionPerformed
        if (pnMain.getComponentCount() != 0 && pnMain.getComponent(0) instanceof User) {
            return;
        }
        User userPane = new User();
        loadComponentsToMainPane(userPane);
        userPane.setStatusBar(statusBar);
        statusBar.setMessage(User.DEFAULT_STATUS, StatusBar.MESSAGE_TYPE);
    }//GEN-LAST:event_mitUsersActionPerformed

    private void mitStudentsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mitStudentsActionPerformed
        if (pnMain.getComponentCount() != 0 && pnMain.getComponent(0) instanceof Student) {
            return;
        }
        Student studentPane = new Student();
        loadComponentsToMainPane(studentPane);
        if (!loginUser.isAdmin()) {
            studentPane.getBtnAdd().setEnabled(false);
            studentPane.getBtnUpdate().setEnabled(false);
        }
        studentPane.setStatusBar(statusBar);
        statusBar.setMessage(Student.DEFAULT_STATUS, StatusBar.MESSAGE_TYPE);
    }//GEN-LAST:event_mitStudentsActionPerformed

    private void mitSubjectsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mitSubjectsActionPerformed
        if (pnMain.getComponentCount() != 0 && pnMain.getComponent(0) instanceof Subject) {
            return;
        }
        Subject subjectPane = new Subject();
        loadComponentsToMainPane(subjectPane);
        subjectPane.setStatusBar(statusBar);
        statusBar.setMessage(Subject.DEFAULT_STATUS, StatusBar.MESSAGE_TYPE);
    }//GEN-LAST:event_mitSubjectsActionPerformed

    private void mitCoursesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mitCoursesActionPerformed
        if (pnMain.getComponentCount() != 0 && pnMain.getComponent(0) instanceof Course) {
            return;
        }
        Course coursePane = new Course();
        loadComponentsToMainPane(coursePane);
        coursePane.setStatusBar(statusBar);
        statusBar.setMessage(Course.DEFAULT_STATUS, StatusBar.MESSAGE_TYPE);
    }//GEN-LAST:event_mitCoursesActionPerformed

    private void mitSchedulesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mitSchedulesActionPerformed
        if (pnMain.getComponentCount() != 0 && pnMain.getComponent(0) instanceof Schedule) {
            return;
        }
        Schedule schedulePane = new Schedule();
        loadComponentsToMainPane(schedulePane);
        schedulePane.addInvalidEditListener(new InvalidEditListener() {
            @Override
            public void invalidEdited(InvalidEditEvent evt) {
                if (evt.getSource().equals(Subject.class)) {
                    if (pnMain.getComponentCount() != 0 && pnMain.getComponent(0) instanceof CourseSubject) {
                        return;
                    }
                    CourseSubject subjectPane = new CourseSubject();
                    loadComponentsToMainPane(subjectPane);
                    subjectPane.setStatusBar(statusBar);
                    statusBar.setMessage(CourseSubject.DEFAULT_STATUS, StatusBar.MESSAGE_TYPE);
                }

                if (evt.getSource().equals(User.class)) {
                    if (pnMain.getComponentCount() != 0 && pnMain.getComponent(0) instanceof UserSubject) {
                        return;
                    }
                    UserSubject userPane = new UserSubject();
                    loadComponentsToMainPane(userPane);
                    userPane.setStatusBar(statusBar);
                    statusBar.setMessage(UserSubject.DEFAULT_STATUS, StatusBar.MESSAGE_TYPE);
                }
            }
        });
        schedulePane.setStatusBar(statusBar);
        statusBar.setMessage(Schedule.DEFAULT_STATUS, StatusBar.MESSAGE_TYPE);
    }//GEN-LAST:event_mitSchedulesActionPerformed

    private void mitCalculatorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mitCalculatorActionPerformed
        try {
            Runtime.getRuntime().exec("rundll32.exe url.dll,FileProtocolHandler calc.exe");
        } catch (IOException ex) {
            logger.log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_mitCalculatorActionPerformed

    private void mitHelpActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mitHelpActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_mitHelpActionPerformed

    private void mitAboutActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mitAboutActionPerformed
        About about = new About(null,false);
        about.setLocationRelativeTo(jToolBar2);
        about.pack();
        about.setVisible(true);

    }//GEN-LAST:event_mitAboutActionPerformed

    private void btnProfileActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnProfileActionPerformed
        if (pnMain.getComponentCount() != 0 && pnMain.getComponent(0) instanceof UserProfile) {
            return;
        }
        UserProfile userPane = new UserProfile();
        loadComponentsToMainPane(userPane);
        userPane.setStatusBar(statusBar);
        userPane.setLoginUser(loginUser);
        statusBar.setMessage(UserProfile.DEFAULT_STATUS, StatusBar.MESSAGE_TYPE);
    }//GEN-LAST:event_btnProfileActionPerformed

    private void btnLogOutActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnLogOutActionPerformed
        int confirm = JOptionPane.showConfirmDialog(
                this,
                "Are you sure want to log out from system?",
                "Message",
                JOptionPane.OK_CANCEL_OPTION);
        if (confirm == JOptionPane.OK_OPTION) {
            statusBar.setMessage("Please login to system.", StatusBar.MESSAGE_TYPE);
            doLogout();
        }
    }//GEN-LAST:event_btnLogOutActionPerformed

    private void btnUsersActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnUsersActionPerformed
        if (pnMain.getComponentCount() != 0 && pnMain.getComponent(0) instanceof User) {
            return;
        }
        User userPane = new User();
        loadComponentsToMainPane(userPane);
        userPane.setStatusBar(statusBar);
        statusBar.setMessage(User.DEFAULT_STATUS, StatusBar.MESSAGE_TYPE);
    }//GEN-LAST:event_btnUsersActionPerformed

    private void btnStudentsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnStudentsActionPerformed
        if (pnMain.getComponentCount() != 0 && pnMain.getComponent(0) instanceof Student) {
            return;
        }
        Student studentPane = new Student();
        loadComponentsToMainPane(studentPane);
        if (!loginUser.isAdmin()) {
            studentPane.getBtnAdd().setEnabled(false);
            studentPane.getBtnUpdate().setEnabled(false);
        }
        studentPane.setStatusBar(statusBar);
        statusBar.setMessage(Student.DEFAULT_STATUS, StatusBar.MESSAGE_TYPE);
    }//GEN-LAST:event_btnStudentsActionPerformed

    private void btnSubjectsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSubjectsActionPerformed
        if (pnMain.getComponentCount() != 0 && pnMain.getComponent(0) instanceof Subject) {
            return;
        }
        Subject subjectPane = new Subject();
        loadComponentsToMainPane(subjectPane);
        subjectPane.setStatusBar(statusBar);
        statusBar.setMessage(Subject.DEFAULT_STATUS, StatusBar.MESSAGE_TYPE);
    }//GEN-LAST:event_btnSubjectsActionPerformed

    private void btnCoursesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCoursesActionPerformed
        if (pnMain.getComponentCount() != 0 && pnMain.getComponent(0) instanceof Course) {
            return;
        }
        Course coursePane = new Course();
        loadComponentsToMainPane(coursePane);
        coursePane.setStatusBar(statusBar);
        statusBar.setMessage(Course.DEFAULT_STATUS, StatusBar.MESSAGE_TYPE);
    }//GEN-LAST:event_btnCoursesActionPerformed

    private void btnSchedulesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSchedulesActionPerformed
        if (pnMain.getComponentCount() != 0 && pnMain.getComponent(0) instanceof Schedule) {
            return;
        }
        Schedule schedulePane = new Schedule();
        schedulePane.addInvalidEditListener(new InvalidEditListener() {
            @Override
            public void invalidEdited(InvalidEditEvent evt) {
                if (evt.getSource().equals(Subject.class)) {
                    if (pnMain.getComponentCount() != 0 && pnMain.getComponent(0) instanceof CourseSubject) {
                        return;
                    }
                    CourseSubject subjectPane = new CourseSubject();
                    loadComponentsToMainPane(subjectPane);
                    subjectPane.setStatusBar(statusBar);
                    statusBar.setMessage(CourseSubject.DEFAULT_STATUS, StatusBar.MESSAGE_TYPE);
                }

                if (evt.getSource().equals(User.class)) {
                    if (pnMain.getComponentCount() != 0 && pnMain.getComponent(0) instanceof UserSubject) {
                        return;
                    }
                    UserSubject userPane = new UserSubject();
                    loadComponentsToMainPane(userPane);
                    userPane.setStatusBar(statusBar);
                    statusBar.setMessage(UserSubject.DEFAULT_STATUS, StatusBar.MESSAGE_TYPE);
                }
            }
        });
        loadComponentsToMainPane(schedulePane);
        schedulePane.setStatusBar(statusBar);
        statusBar.setMessage(Schedule.DEFAULT_STATUS, StatusBar.MESSAGE_TYPE);
    }//GEN-LAST:event_btnSchedulesActionPerformed

    private void btnCalculatorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCalculatorActionPerformed
        try {
            Runtime.getRuntime().exec("rundll32.exe url.dll,FileProtocolHandler calc.exe");
        } catch (IOException ex) {
            logger.log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_btnCalculatorActionPerformed

    private void formWindowClosing(WindowEvent evt) {//GEN-FIRST:event_formWindowClosing
        try {
            Config.connection.close();
            logger.info("Exiting...");
        } catch (SQLException e1) {
            logger.log(Level.WARNING, "Unable to close connection.");
        } finally {
            System.exit(0);
        }
    }//GEN-LAST:event_formWindowClosing

    private void btnCourseYearsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCourseYearsActionPerformed
        if (pnMain.getComponentCount() != 0 && pnMain.getComponent(0) instanceof CourseYear) {
            return;
        }
        CourseYear coursePane = new CourseYear();
        loadComponentsToMainPane(coursePane);
        coursePane.setStatusBar(statusBar);
        statusBar.setMessage(CourseYear.DEFAULT_STATUS, StatusBar.MESSAGE_TYPE);
    }//GEN-LAST:event_btnCourseYearsActionPerformed

    private void mitClassesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mitClassesActionPerformed
        if (pnMain.getComponentCount() != 0 && pnMain.getComponent(0) instanceof _Class) {
            return;
        }
        _Class classPane = new _Class();
        loadComponentsToMainPane(classPane);
        classPane.setStatusBar(statusBar);
        statusBar.setMessage(_Class.DEFAULT_STATUS, StatusBar.MESSAGE_TYPE);
    }//GEN-LAST:event_mitClassesActionPerformed

    private void mitCourseYearsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mitCourseYearsActionPerformed
        if (pnMain.getComponentCount() != 0 && pnMain.getComponent(0) instanceof CourseYear) {
            return;
        }
        CourseYear coursePane = new CourseYear();
        loadComponentsToMainPane(coursePane);
        coursePane.setStatusBar(statusBar);
        statusBar.setMessage(CourseYear.DEFAULT_STATUS, StatusBar.MESSAGE_TYPE);
    }//GEN-LAST:event_mitCourseYearsActionPerformed

    private void btnClassesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnClassesActionPerformed
        if (pnMain.getComponentCount() != 0 && pnMain.getComponent(0) instanceof _Class) {
            return;
        }
        _Class classPane = new _Class();
        loadComponentsToMainPane(classPane);
        classPane.setStatusBar(statusBar);
        statusBar.setMessage(_Class.DEFAULT_STATUS, StatusBar.MESSAGE_TYPE);
    }//GEN-LAST:event_btnClassesActionPerformed

    private void mitSemestersActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mitSemestersActionPerformed
        if (pnMain.getComponentCount() != 0 && pnMain.getComponent(0) instanceof Semester) {
            return;
        }
        Semester semesterPane = new Semester();
        loadComponentsToMainPane(semesterPane);
        semesterPane.setStatusBar(statusBar);
        statusBar.setMessage(Semester.DEFAULT_STATUS, StatusBar.MESSAGE_TYPE);
    }//GEN-LAST:event_mitSemestersActionPerformed

    private void mitAttendanceActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mitAttendanceActionPerformed
        if (pnMain.getComponentCount() != 0 && pnMain.getComponent(0) instanceof Attendance) {
            return;
        }
        Attendance attendancePane = new Attendance();
        loadComponentsToMainPane(attendancePane);
        attendancePane.setStatusBar(statusBar);
        statusBar.setMessage(Attendance.DEFAULT_STATUS, StatusBar.MESSAGE_TYPE);
    }//GEN-LAST:event_mitAttendanceActionPerformed

    private void btnSemesterActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSemesterActionPerformed
        if (pnMain.getComponentCount() != 0 && pnMain.getComponent(0) instanceof Semester) {
            return;
        }
        Semester semesterPane = new Semester();
        loadComponentsToMainPane(semesterPane);
        semesterPane.setStatusBar(statusBar);
        statusBar.setMessage(Semester.DEFAULT_STATUS, StatusBar.MESSAGE_TYPE);
    }//GEN-LAST:event_btnSemesterActionPerformed

    private void btnAttendanceActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAttendanceActionPerformed
        if (pnMain.getComponentCount() != 0 && pnMain.getComponent(0) instanceof Attendance) {
            return;
        }
        Attendance attendancePane = new Attendance();
        loadComponentsToMainPane(attendancePane);
        attendancePane.setStatusBar(statusBar);
        statusBar.setMessage(Attendance.DEFAULT_STATUS, StatusBar.MESSAGE_TYPE);
    }//GEN-LAST:event_btnAttendanceActionPerformed

    private void btnCourseSubjectActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCourseSubjectActionPerformed
        if (pnMain.getComponentCount() != 0 && pnMain.getComponent(0) instanceof CourseSubject) {
            return;
        }
        CourseSubject coursePane = new CourseSubject();
        loadComponentsToMainPane(coursePane);
        coursePane.setStatusBar(statusBar);
        statusBar.setMessage(CourseSubject.DEFAULT_STATUS, StatusBar.MESSAGE_TYPE);
    }//GEN-LAST:event_btnCourseSubjectActionPerformed

    private void btnUserSubjectActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnUserSubjectActionPerformed
        if (pnMain.getComponentCount() != 0 && pnMain.getComponent(0) instanceof UserSubject) {
            return;
        }
        UserSubject userPane = new UserSubject();
        loadComponentsToMainPane(userPane);
        userPane.setStatusBar(statusBar);
        statusBar.setMessage(UserSubject.DEFAULT_STATUS, StatusBar.MESSAGE_TYPE);
    }//GEN-LAST:event_btnUserSubjectActionPerformed

    private void mitCourseSubjectActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mitCourseSubjectActionPerformed
        if (pnMain.getComponentCount() != 0 && pnMain.getComponent(0) instanceof CourseSubject) {
            return;
        }
        CourseSubject coursePane = new CourseSubject();
        loadComponentsToMainPane(coursePane);
        coursePane.setStatusBar(statusBar);
        statusBar.setMessage(CourseSubject.DEFAULT_STATUS, StatusBar.MESSAGE_TYPE);
    }//GEN-LAST:event_mitCourseSubjectActionPerformed

    private void mitUserSubjectActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mitUserSubjectActionPerformed
        if (pnMain.getComponentCount() != 0 && pnMain.getComponent(0) instanceof UserSubject) {
            return;
        }
        UserSubject userPane = new UserSubject();
        loadComponentsToMainPane(userPane);
        userPane.setStatusBar(statusBar);
        statusBar.setMessage(UserSubject.DEFAULT_STATUS, StatusBar.MESSAGE_TYPE);
    }//GEN-LAST:event_mitUserSubjectActionPerformed

    private void mitFineActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mitFineActionPerformed
        if (pnMain.getComponentCount() != 0 && pnMain.getComponent(0) instanceof Fine) {
            return;
        }
        Fine finePane = new Fine();
        loadComponentsToMainPane(finePane);
        finePane.setStatusBar(statusBar);
        statusBar.setMessage(Fine.DEFAULT_STATUS, StatusBar.MESSAGE_TYPE);
    }//GEN-LAST:event_mitFineActionPerformed

    private void btnFineActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnFineActionPerformed
        if (pnMain.getComponentCount() != 0 && pnMain.getComponent(0) instanceof Fine) {
            return;
        }
        Fine finePane = new Fine();
        loadComponentsToMainPane(finePane);
        finePane.setStatusBar(statusBar);
        statusBar.setMessage(Fine.DEFAULT_STATUS, StatusBar.MESSAGE_TYPE);
    }//GEN-LAST:event_btnFineActionPerformed

    private void btnCancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCancelActionPerformed
        dlgChangePw.dispose();
    }//GEN-LAST:event_btnCancelActionPerformed

    private void btnSaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSaveActionPerformed
        try {
            List<UserInfo> toUpdate = new UserDb().select(loginUser.getEmail());
            for (UserInfo u : toUpdate) {
                String oldPw = String.copyValueOf(jpfOldPw.getPassword());
                String newPw = String.copyValueOf(jpfNewPw.getPassword());
                String confirmPw = String.copyValueOf(jpfConfirmPw.getPassword());
                if (!oldPw.equals(u.getPassword())) {
                    JOptionPane.showMessageDialog(
                            this,
                            "Your old password is invalid.",
                            "Error",
                            JOptionPane.ERROR_MESSAGE
                    );
                } else if (!newPw.equals(confirmPw)) {
                    JOptionPane.showMessageDialog(
                            this,
                            "Password do not match.",
                            "Message",
                            JOptionPane.INFORMATION_MESSAGE
                    );
                } else {
                    dlgChangePw.dispose();
                    u.setPassword(newPw);
                    new UserDb().update(u);
                    loginUser = u;
                    statusBar.setMessage("Your password has been changed.", StatusBar.MESSAGE_TYPE);
                }
            }

        } catch (SQLException e) {
            logger.log(Level.WARNING, null, e);
            statusBar.setMessage("Error connecting to database", StatusBar.ERROR_TYPE);
        }
    }//GEN-LAST:event_btnSaveActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnAttendance;
    private javax.swing.JButton btnCalculator;
    private javax.swing.JButton btnCancel;
    private javax.swing.JButton btnClasses;
    private javax.swing.JButton btnCourseSubject;
    private javax.swing.JButton btnCourseYears;
    private javax.swing.JButton btnCourses;
    private javax.swing.JButton btnFine;
    private javax.swing.JButton btnLogOut;
    private javax.swing.JButton btnProfile;
    private javax.swing.JButton btnSave;
    private javax.swing.JButton btnSchedules;
    private javax.swing.JButton btnSemester;
    private javax.swing.JButton btnStudents;
    private javax.swing.JButton btnSubjects;
    private javax.swing.JButton btnUserSubject;
    private javax.swing.JButton btnUsers;
    private javax.swing.JDialog dlgChangePw;
    private javax.swing.JDialog dlgUserInfo;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenu jMenu3;
    private javax.swing.JMenu jMenu4;
    private javax.swing.JMenu jMenu5;
    private javax.swing.JMenu jMenu6;
    private javax.swing.JMenu jMenu7;
    private javax.swing.JMenu mnTheme;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JPopupMenu.Separator jSeparator1;
    private javax.swing.JSeparator jSeparator2;
    private javax.swing.JPopupMenu.Separator jSeparator3;
    private javax.swing.JPopupMenu.Separator jSeparator4;
    private javax.swing.JSeparator jSeparator5;
    private javax.swing.JToolBar jToolBar1;
    private javax.swing.JToolBar jToolBar2;
    private javax.swing.JToolBar jToolBar3;
    private javax.swing.JScrollPane jcpMain;
    private javax.swing.JPasswordField jpfConfirmPw;
    private javax.swing.JPasswordField jpfNewPw;
    private javax.swing.JPasswordField jpfOldPw;
    private javax.swing.JLabel lblEmail;
    private javax.swing.JLabel lblMobile;
    private javax.swing.JLabel lblName;
    private javax.swing.JLabel lblRole;
    private javax.swing.JMenuItem mitAbout;
    private javax.swing.JMenuItem mitAttendance;
    private javax.swing.JMenuItem mitCalculator;
    private javax.swing.JMenuItem mitClasses;
    private javax.swing.JMenuItem mitConfig;
    private javax.swing.JMenuItem mitCourseSubject;
    private javax.swing.JMenuItem mitCourseYears;
    private javax.swing.JMenuItem mitCourses;
    private javax.swing.JMenuItem mitExit;
    private javax.swing.JMenuItem mitFine;
    private javax.swing.JMenuItem mitHelp;
    private javax.swing.JMenuItem mitLogOut;
    private javax.swing.JMenuItem mitProfile;
    private javax.swing.JMenuItem mitSchedules;
    private javax.swing.JMenuItem mitSemesters;
    private javax.swing.JMenuItem mitStudents;
    private javax.swing.JMenuItem mitSubjects;
    private javax.swing.JMenuItem mitUserSubject;
    private javax.swing.JMenuItem mitUsers;
	private javax.swing.JMenuItem mitSAutumnLaf;
    private javax.swing.JMenuItem mitSCremeLaf;
    private javax.swing.JMenuItem mitSBlackBusinessLaf;
    private javax.swing.JPanel pnChangePw;
    private javax.swing.JPanel pnMain;
    private javax.swing.JPanel pnUserInfo;
    private StatusBar statusBar;
    // End of variables declaration//GEN-END:variables
}